/**
 * 中午工作状态
 * @author liaosh
 * @date 2022-10-18 22:49
 */
public class NoonState implements State {

    @Override
    public void writeProgram(Work work) {
        if (work.getCurrentHour() < 13) {
            System.out.println("当前时间：" + work.getCurrentHour() + "点，午休时间不工作");
        } else {
            // 超过 13 点，转入下午工作状态
            work.setCurrentWorkState(new AfternoonState());
            work.writeProgram();
        }
    }
}
